home *** CD-ROM | disk | FTP | other *** search
Wrap
mmmmlllloooocccckkkk((((3333CCCC)))) mmmmlllloooocccckkkk((((3333CCCC)))) NNNNAAAAMMMMEEEE _mmmm_llll_oooo_cccc_kkkk, _mmmm_uuuu_nnnn_llll_oooo_cccc_kkkk - lock or unlock pages in memory SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_>>>> _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_mmmm_mmmm_aaaa_nnnn_...._hhhh_>>>> _iiii_nnnn_tttt _mmmm_llll_oooo_cccc_kkkk_((((_cccc_oooo_nnnn_ssss_tttt _vvvv_oooo_iiii_dddd _****_a_d_d_r_,,,, _ssss_iiii_zzzz_eeee______tttt _l_e_n_))))_;;;; _iiii_nnnn_tttt _mmmm_uuuu_nnnn_llll_oooo_cccc_kkkk_((((_cccc_oooo_nnnn_ssss_tttt _vvvv_oooo_iiii_dddd _****_a_d_d_r_,,,, _ssss_iiii_zzzz_eeee______tttt _l_e_n_))))_;;;; DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN _mmmm_llll_oooo_cccc_kkkk locks the pages associated with the address range (_a_d_d_r, _a_d_d_r + _l_e_n) into memory. The super-user can lock as many pages as it wishes, other users are limited to a per process maximum {_P_L_O_C_K__M_A_X}. Locks established with _mmmm_llll_oooo_cccc_kkkk are not inherited by a child process after a _ffff_oooo_rrrr_kkkk. _mmmm_uuuu_nnnn_llll_oooo_cccc_kkkk unlocks the pages associated with the address range (_a_d_d_r, _a_d_d_r + _l_e_n), regardless of the number of times the pages were locked. Page locks established by other processes are unaffected, when the pages are shared amongst multiple processes. Address _a_d_d_r is not required to be page aligned, as the system automatically rounds the address down to the nearest page boundary. _mmmm_llll_oooo_cccc_kkkk or _mmmm_uuuu_nnnn_llll_oooo_cccc_kkkk will fail if one or more of the following are true: [EAGAIN] There was insufficient lockable memory to lock the entire address range (_a_d_d_r, _a_d_d_r + _l_e_n). This may occur even though the amount requested was less than the system-imposed maximum number of locked pages. [EBUSY] _mmmm_uuuu_nnnn_llll_oooo_cccc_kkkk will fail with this error if the address range specified has some active I/O initiated by some other process belonging to same share group. [ENOMEM] The addresses specified by (addr, addr + len) are not mapped into the user's address space. [ENOMEM] The caller was not super-user and the number of pages to be locked exceeded the per process limit {_P_L_O_C_K__M_A_X} [see _iiii_nnnn_tttt_rrrr_oooo(2)]. [ENOMEM] The total number of pages locked by the caller would exceed the maximum resident size for the process [see _ssss_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt(2)]. [ENOSPC] The address range (_a_d_d_r, _a_d_d_r + _l_e_n) contains a memory-mapped file, and there is insufficient space on the device to allocate the entire file. PPPPaaaaggggeeee 1111 mmmmlllloooocccckkkk((((3333CCCC)))) mmmmlllloooocccckkkk((((3333CCCC)))) SEE ALSO exec(2), exit(2), fork(2), mlockall(3C), munlockall(3C), mmap(2), mpin(2), munpin(2), plock(2) DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS Upon successful completion, the functions _mmmm_llll_oooo_cccc_kkkk and _mmmm_uuuu_nnnn_llll_oooo_cccc_kkkk return 0, otherwise, they return -1 and set _eeee_rrrr_rrrr_nnnn_oooo to indicate the error. WWWWAAAARRRRNNNNIIIINNNNGGGG The functions _mmmm_llll_oooo_cccc_kkkk_////_mmmm_uuuu_nnnn_llll_oooo_cccc_kkkk and _mmmm_pppp_iiii_nnnn_////_mmmm_uuuu_nnnn_pppp_iiii_nnnn provide similar functionality. The major difference between the two sets is that _mmmm_pppp_iiii_nnnn_////_mmmm_uuuu_nnnn_pppp_iiii_nnnn maintains a per page lock counter and _mmmm_llll_oooo_cccc_kkkk_////_mmmm_uuuu_nnnn_llll_oooo_cccc_kkkk does not. Developers should choose the set that best suites their application and stick with it, as mixing the interfaces may result in unexpected behavior. PPPPaaaaggggeeee 2222